namespace CodeConsult.Nordic.nRF8001.ApplicationControlInterface.Commands.SystemCommands
{
    public class TestCommand : AciCommandBase
    {
        public const byte OpCode = 0x01;

        public byte TestFeature { get; set; }

        protected override void EncodeBuffer()
        {
            Error = !(TestFeature == 0x01 || TestFeature == 0x02 || TestFeature == 0xFF);

            if (Error) return;

            EncodeBufferWithCommandHeader(OpCode, 1);
            EncodeHelper.SetByte(TestFeature);
        }
    }
}
